package 开始的算法算法入门8月.位运算;
// https://leetcode-cn.com/problems/reverse-bits/
public class 位190颠倒二进制位0825结束了 {
    public class Solution {
        public int reverseBits(int n) {
            int rev = 0;
            for (int i = 0; i < 32 && n != 0; ++i) {
                rev |= (n & 1) << (31 - i);
                n >>>= 1;
            }
            return rev;
        }
    }

}
